#include <bits/stdc++.h>
using namespace std;
#define int long long

int n, a0; 

struct Info {
	int a, h;

} a[200005];

bool cmp1(const Info &i, const Info &j)  {
	return i.h < j.h;
}
bool cmp2(const Info &i, const Info &j)  {
	return i.a < j.a;
}
bool cmp3(const Info &i, const Info &j)  {
	return i.a > j.a;
}
bool cmp4(const Info &i, const Info &j)  {
	return i.h * i.a < j.h * j.a;
}
bool cmp5(const Info &i, const Info &j)  {
	if (i.a != j.a) return i.a < j.a;
	return (i.h -1)* i.a > (j.h-1) * j.a;
}

namespace CR200J {
	int dfs(int f, int a0) {
		if (f == (1 << n) - 1) return 0;
		int ans = 1ll << 60;
		for (int j = 1; j <= n; ++j) {
			if (!(f & (1 << (j - 1)))) {
				ans = min(ans, dfs(f | (1 << (j - 1)), max(a0, a[j].a)) + ((a[j].h-1) / a0) * a[j].a);
			}
		}
		return ans;
	}
	void main() {
		cout << dfs(0, a0) << "\n";
	}
}
/*
   1 6
   3 2
   4 4
   5 6
*/

namespace BF5033 {
	int ans = 1ll << 60;
	void solve() {
		int a00 = a0, tms = 0;
		for (int i = 1; i <= n; ++i) {
			tms += (a[i].h / a00) * a[i].a;
			a00 = max(a00, a[i].a);
		}
		ans = min(ans, tms);
	}
	void main()  {
		solve();
		reverse(a + 1, a + n + 1);
		solve();
		mt19937 rnd(time(0));
		const int Sumsec = (CLOCKS_PER_SEC == 1000 ? 4 : 2);
		while (clock() <= CLOCKS_PER_SEC * Sumsec * 0.1) {
			shuffle(a + 1, a + n + 1, rnd);
			sort(a + 1, a + n + 1, cmp1);
			solve();
		}
		while (clock() <= CLOCKS_PER_SEC * Sumsec * 0.25) {
			shuffle(a + 1, a + n + 1, rnd);
			sort(a + 1, a + n + 1, cmp2);
			solve();
		}
		while (clock() <= CLOCKS_PER_SEC * Sumsec * 0.4) {
			shuffle(a + 1, a + n + 1, rnd);
			sort(a + 1, a + n + 1, cmp3);
			solve();
		}
		while (clock() <= CLOCKS_PER_SEC * Sumsec * 0.55) {
			shuffle(a + 1, a + n + 1, rnd);
			sort(a + 1, a + n + 1, cmp4);
			solve();
		}
		while (clock() <= CLOCKS_PER_SEC * Sumsec * 0.65) {
			shuffle(a + 1, a + n + 1, rnd);
			sort(a + 1, a + n + 1, cmp5);
			solve();
		}
		while (clock() <= CLOCKS_PER_SEC * Sumsec * 0.95) {
			shuffle(a + 1, a + n + 1, rnd);
			solve();
		}
		cout << ans << "\n";
	}
}
signed main() {
	freopen("xinyue.in", "r", stdin); freopen("xinyue.out", "w", stdout);
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> n >> a0;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i].a >> a[i].h;
	}
	if (n <= 10) {
		CR200J::main();
	} else BF5033::main();
	return 0;
}
